<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

$cid = $route->GET('cid');
$address = UV::readMQ(strip_tags($route->POST('address')));
$phone = UV::readMQ(strip_tags($route->POST('phone')));

if (!($ao_id = $route->getAdminId()))
	goToPage("/admin/offices?cid=$cid&edit=fail");


$query = "update `additional_office` set `address` = '$address',`phone`='$phone' where `ao_id` = '$ao_id' limit 1";
$update = $db->sendQuery($query);
if ($update)
	goToPage("/admin/offices/?cid=$cid&edit=success");
else
	goToPage("/admin/offices/?cid=$cid&edit=fail");

?>